package design_pattern.state.demo02;

import design_pattern.state.demo02.state.State;
import lombok.Data;

/**
 * @version 1.0.0
 * Created by cyd on 2022-06-05 16:36:47
 * @Description : 接口描述
 */
@Data
public class WorkContext {

    private float hour;

    private State state;

    public WorkContext(State state) {
        this.state = state;
    }

    public void writeProgram(WorkContext workContext) {
        System.out.println("当前状态" + this.state.getClass());
        this.state.handleState(workContext);
    }
}
